package com.twu.biblioteca.controllers;

import com.twu.biblioteca.db.Database;
import com.twu.biblioteca.models.Movie;

public class MovieController {
    private Database database;

    public MovieController(Database database) {
        this.database = database;
    }

    public String listMovies() {
        String listedMovies = "";

        for (Movie movie : database.getAllMovies()) {
            listedMovies += movie.getName() + "\t" + movie.getYear() + "\t" +
                    movie.getDirector() + "\t" + movie.getRating() + "\n";
        }
        return listedMovies;
    }
}